/*
 Navicat MySQL Data Transfer

 Source Server         : guest
 Source Server Type    : MySQL
 Source Server Version : 80013
 Source Host           : 127.0.0.1:3306
 Source Schema         : miaosha

 Target Server Type    : MySQL
 Target Server Version : 80013
 File Encoding         : 65001

 Date: 22/01/2019 23:41:08
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for item
-- ----------------------------
DROP TABLE IF EXISTS `item`;
CREATE TABLE `item` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `price` double(10,0) NOT NULL DEFAULT '0',
  `description` varchar(500) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `sales` int(4) NOT NULL DEFAULT '0',
  `img_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of item
-- ----------------------------
BEGIN;
INSERT INTO `item` VALUES (3, 'iphoneXR', 4999, '最好用的苹果手机', 3, 'https://img14.360buyimg.com/n0/jfs/t1/828/9/3952/100157/5b9a1133Ec4dff632/899d9f95362dad79.jpg');
INSERT INTO `item` VALUES (4, 'iphone X', 6288, '第二好用的苹果手机', 21, 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1547995978326&di=4ad28b24cf1e67b07a35731e74cc8dbe&imgtype=0&src=http%3A%2F%2Fnews.mydrivers.com%2Fimg%2F20170414%2Fs_70505a7b80cd46dc990444c78dffce6f.jpg');
INSERT INTO `item` VALUES (8, 'iphone se2', 4288, '第三好用的苹果手机', 36, 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1547996589091&di=07c3558b8c5c8ba7bb9b9cdd4e0cc1f7&imgtype=0&src=http%3A%2F%2Fimage.it168.com%2Fn%2F640x480%2F5%2F5024%2F5024720.jpg');
COMMIT;

-- ----------------------------
-- Table structure for item_stock
-- ----------------------------
DROP TABLE IF EXISTS `item_stock`;
CREATE TABLE `item_stock` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `stock` int(11) NOT NULL DEFAULT '0',
  `item_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `item_id` (`item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of item_stock
-- ----------------------------
BEGIN;
INSERT INTO `item_stock` VALUES (11, 99, 3);
INSERT INTO `item_stock` VALUES (12, 200, 4);
INSERT INTO `item_stock` VALUES (13, 295, 8);
COMMIT;

-- ----------------------------
-- Table structure for order_info
-- ----------------------------
DROP TABLE IF EXISTS `order_info`;
CREATE TABLE `order_info` (
  `id` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `item_id` int(11) NOT NULL DEFAULT '0',
  `item_price` double(10,0) NOT NULL DEFAULT '0',
  `amount` int(11) NOT NULL DEFAULT '0',
  `order_price` double(10,0) NOT NULL DEFAULT '0',
  `promo_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of order_info
-- ----------------------------
BEGIN;
INSERT INTO `order_info` VALUES ('2019012200001200', 27, 8, 0, 1, 0, 0);
INSERT INTO `order_info` VALUES ('2019012200001300', 27, 8, 4288, 1, 4288, 0);
INSERT INTO `order_info` VALUES ('2019012200001400', 27, 8, 4288, 1, 4288, 0);
INSERT INTO `order_info` VALUES ('2019012200001500', 27, 3, 300, 1, 300, 1);
INSERT INTO `order_info` VALUES ('2019012200001700', 27, 8, 4288, 1, 4288, 0);
INSERT INTO `order_info` VALUES ('2019012200001800', 27, 8, 4288, 1, 4288, 0);
COMMIT;

-- ----------------------------
-- Table structure for promo
-- ----------------------------
DROP TABLE IF EXISTS `promo`;
CREATE TABLE `promo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `promo_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `start_date` datetime NOT NULL,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `promo_item_price` double(10,0) NOT NULL DEFAULT '0',
  `end_date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of promo
-- ----------------------------
BEGIN;
INSERT INTO `promo` VALUES (1, 'iphone4抢购活动', '2019-01-22 22:49:45', 3, 300, '2019-01-22 23:40:45');
COMMIT;

-- ----------------------------
-- Table structure for sequence_info
-- ----------------------------
DROP TABLE IF EXISTS `sequence_info`;
CREATE TABLE `sequence_info` (
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `current_value` int(11) NOT NULL DEFAULT '0',
  `step` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of sequence_info
-- ----------------------------
BEGIN;
INSERT INTO `sequence_info` VALUES ('order_info', 19, 1);
COMMIT;

-- ----------------------------
-- Table structure for user_info
-- ----------------------------
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `gender` tinyint(1) NOT NULL DEFAULT '0',
  `age` varchar(4) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `telphone` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `register_mode` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `third_party_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `telphone_unique_index` (`telphone`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of user_info
-- ----------------------------
BEGIN;
INSERT INTO `user_info` VALUES (20, 'WangYongHong', 1, '232', '123', 'byphone', '');
INSERT INTO `user_info` VALUES (21, 'wyh', 2, '23', '123456', 'byphone', '');
INSERT INTO `user_info` VALUES (22, 'WangYongHong', 1, '21', '123321', 'byphone', '');
INSERT INTO `user_info` VALUES (24, 'WangYongHong', 2, '21', '12345678', 'byphone', '');
INSERT INTO `user_info` VALUES (25, 'WangYongHong', 1, '21', '111', 'byphone', '');
INSERT INTO `user_info` VALUES (26, 'WangYongHong', 2, '22', '222', 'byphone', '');
INSERT INTO `user_info` VALUES (27, 'Dr. wang', 1, '36', '444', 'byphone', '');
COMMIT;

-- ----------------------------
-- Table structure for user_password
-- ----------------------------
DROP TABLE IF EXISTS `user_password`;
CREATE TABLE `user_password` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `encrpt_passord` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `user_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of user_password
-- ----------------------------
BEGIN;
INSERT INTO `user_password` VALUES (2, '22bqPpHKJfC/UfOlwvX9aA==', 0);
INSERT INTO `user_password` VALUES (3, '/0b/31QmT45+kysUVr5tkg==', 0);
INSERT INTO `user_password` VALUES (4, 'ebUnkxbGFNLLcCMkqz2Q+Q==', 22);
INSERT INTO `user_password` VALUES (5, 'j6T1BH2zfo2752TqQCDzhw==', 24);
INSERT INTO `user_password` VALUES (6, 'M6+L3rKqW7cEG/fOVyan6A==', 25);
INSERT INTO `user_password` VALUES (7, 'XCsdOFHXZDqOpsglLTgZaw==', 26);
INSERT INTO `user_password` VALUES (8, 'v/L4DRj9hCHS1YES12XiVQ==', 27);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
